<!--
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-05-22 11:50:22
 * @Descripttion: 
--> 
<template>
  <div class="app-container">
    <el-row>
      <el-col :span="24" align="right">
        <el-button type="primary" @click="onCreate">+ 新增定时模板</el-button>
      </el-col>
    </el-row>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="id" label="#" width="120">
      </el-table-column>
      <el-table-column prop="name" label="消息类型" width="200">
      </el-table-column>
      <el-table-column prop="province" label="消息内容">
      </el-table-column>
      <el-table-column label="操作" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
          <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <el-pagination
      style="margin-top: 8px;"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="1"
      :page-size="10"
      layout="total, sizes, prev, pager, next, jumper"
      :total="10"
    ></el-pagination>
    <!--编辑定时模板-->
    <el-dialog title="编辑定时模板" :visible.sync="dialogFormVisible" width="500px">
        <el-form label-width="80px" :model="form" ref="provinceForm">
          <el-form-item label="名称" prop="name" :rules="[{ required: true, message: '年龄不能为空'}]">
            <el-input v-model="form.name" autocomplete="off" style="width: 370px;"></el-input>
          </el-form-item>
          <el-form-item label="模板内容">
            <el-input type="textarea" v-model="form.content" style="width: 370px;"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="submitForm">确 定</el-button>
        </div>
      </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        dialogFormVisible: false,
        tableData: [{
          id: '1',
          date: '山西XX111用电企业',
          name: '申报下月电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在本月10日之前申报下月预估电量和上月实际电量使用情况，如已申报请忽略。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '2',
          date: '山西XX111用电企业',
          name: '申报日前电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在明日8点前申报XX号预估用电量。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '3',
          date: '山西XX111用电企业',
          name: '申报下月电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在本月10日之前申报下月预估电量和上月实际电量使用情况，如已申报请忽略。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '4',
          date: '山西XX111用电企业',
          name: '五一放假通知',
          province: '尊敬的客户您好，五一假期即将来临，国晶新能源温馨提示您：疫情还未结束，为了您的健康，五一期间提倡在市内活动，尽量减少出行，祝您及家人健康快乐！',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '5',
          date: '山西XX111用电企业',
          name: '申报日前电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在明日8点前申报XX号预估用电量。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '6',
          date: '山西XX111用电企业',
          name: '申报下月电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在本月10日之前申报下月预估电量和上月实际电量使用情况，如已申报请忽略。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '7',
          date: '山西XX111用电企业',
          name: '五一放假通知',
          province: '尊敬的客户您好，五一假期即将来临，国晶新能源温馨提示您：疫情还未结束，为了您的健康，五一期间提倡在市内活动，尽量减少出行，祝您及家人健康快乐！',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '8',
          date: '山西XX111用电企业',
          name: '申报日前电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在明日8点前申报XX号预估用电量。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '9',
          date: '山西XX111用电企业',
          name: '申报下月电量',
          province: '尊敬的客户您好，为了更好的服务贵单位参与代理购电，请您在本月10日之前申报下月预估电量和上月实际电量使用情况，如已申报请忽略。',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }, {
          id: '10',
          date: '山西XX111用电企业',
          name: '五一放假通知',
          province: '尊敬的客户您好，五一假期即将来临，国晶新能源温馨提示您：疫情还未结束，为了您的健康，五一期间提倡在市内活动，尽量减少出行，祝您及家人健康快乐！',
          city: '150000.00',
          address: '150000.00',
          zip: '张XX',
          look: '15687982659'
        }],
        form: {
          name: '',
          content: ''
        }
      }
    },
    methods: {
      onCreate() {
        this.dialogFormVisible = true;
      },
      submitForm(){
        this.dialogFormVisible = false;
      },
      handleClick(row) {
        console.log(row);
      },
      handleSizeChange(val) {
      },
      handleCurrentChange(val) {
      }
    }
  }
</script>
<style scoped lang="scss">
.el-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
</style>
